<% layout('/layout/default.html', {title: '字典管理', libs: ['validate']}){ %>
<div class="main-content">
		<div class="card-header">
			<i class="fa fa-sitemap"></i>${dict.isNewRecord?'添加字典信息':'编辑字典信息'}
		</div>
		<#form:form id="inputForm" model="${dict}" class="form-horizontal" action="${ctx}/sys/dict/save" method="post">
			<div class="card-body">
				<#form:hidden path="id"/>
				<div class="row">
					<div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
						<div class="form-group row">
							<label class="col-form-label col-lg-4 col-md-4 text-right" for="value" title="键值">
								<span style="color:red;">*</span> 键值：</label>
							<div class="col-lg-8 col-md-8 ">
								<#form:input path="value" maxlength="100" class="form-control form-control-sm required" />
							</div>
						</div>
					</div>
					<div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
						<div class="form-group row">
							<label class="col-form-label col-lg-4 col-md-4 text-right" for="label" title="标签">
								<span style="color:red;">*</span> 标签：
							</label>
							<div class="col-lg-8 col-md-8 ">
								<#form:input path="label" maxlength="100" class="form-control form-control-sm required "/>
							</div>
						</div>
					</div>
				</div>
				
				<div class="row">
					<div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
						<div class="form-group row">
							<label class="col-form-label col-lg-4 col-md-4 text-right" for="type" title="类型">
								<span style="color:red;">*</span> 类型：</label>
							<div class="col-lg-8 col-md-8 ">
								<#form:input path="type"  maxlength="100" class="form-control form-control-sm required" aria-required="true"/>
							</div>
						</div>
					</div>
					<div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
						<div class="form-group row">
							<label class="col-form-label col-lg-4 col-md-4 text-right" for="description" title="描述">
								<span style="color:red;">*</span> 描述：</label>
							<div class="col-lg-8 col-md-8 ">
								<#form:input path="description"  maxlength="100"  class="form-control form-control-sm required" aria-required="true"/>
							</div>
						</div>
					</div>
				</div>
			
				<div class="row">
					<div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
						<div class="form-group row">
							<label class="col-form-label col-lg-4 col-md-4 text-right" for="sort" title="排序">
								排序：
							</label>
							<div class="col-lg-8 col-md-8 ">
								<#form:input path="sort"  maxlength="10" class="form-control form-control-sm "/>
							</div>
						</div>
					</div>
					<div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
						<div class="form-group row">
							<label class="col-form-label col-lg-4 col-md-4 text-right" for="remarks" title="备注信息">
								备注:
							</label>
							<div class="col-lg-8 col-md-8 ">
								<#form:textarea path="remarks" rows="3" cols="32"  class="form-control form-control-sm "></#form:textarea>
							</div>
						</div>
					</div>
				</div>

			</div>
			<div class="box-footer">
				<div class="row">
					<div class="offset-md-2 col-md-10">
						<% if (hasPermi('sys:dict:edit')){ %>
						<button type="submit" class="btn btn-primary btn-sm" id="btnSubmit"><i class="fa fa-check"></i> 保 存</button>
						<% } %>
						<button type="button" class="btn btn-secondary btn-sm" id="btnCancel" onclick="window.parent.closeCurrentTabPage();"><i class="fa fa-reply-all"></i> 关 闭</button>
					</div>
				</div>
			</div>
		</#form:form>
</div>
<% } %>
<script>
$("#inputForm").validate({
	submitHandler: function(form){
		js.ajaxSubmitForm($(form), function(data){
			js.showMessage(data.message);
			if(data.result == 'true'){
				window.parent.closeCurrentTabPage(window.parent.refreshTab);
			}
		});
    }
});
</script>